package com.hezuti.app.service;

import java.io.IOException;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpException;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.methods.PostMethod;

import com.hezuti.common.service.AbstractBaseService;

/**
 * 订票服务层
 * 
 * @author Administrator
 */
public class TicketService extends AbstractBaseService {

    /** 登录入口 */
    private static String loginUrl	  = "https://dynamic.12306.cn/otsweb/loginAction.do;jsessionid=A99452C841D5B4D7BB92585B042EC33A?method=login";

    /** 车票查询入口 */
    private static String checkUrl	  = "https://dynamic.12306.cn/otsweb/indexAction.do?";

    /** 订票入口 */
    private static String orderUrl	  = "https://dynamic.12306.cn/otsweb/order/querySingleAction.do?method=submutOrderRequest";

    private static String from_telecode     = "orderRequest.from_station_telecode";
    private static String from_name	 = "orderRequest.from_station_name";
    private static String to_telecode       = "orderRequest.to_station_telecode";
    private static String to_name	   = "orderRequest.to_station_name";
    private static String train_date	= "orderRequest.train_date";										 // 2011-12-23
    private static String start_time_str    = "orderRequest.start_time_str";									     // 06%3A00--12%3A00
    private static String train_no	  = "orderRequest.train_no";
    private static String trainCodeText     = "orderRequest.trainCodeText";
    private static String roundTrainDate    = "roundTrainDate";											  // 2011-12-22
    private static String trainClassArr     = "trainClassArr";											   // D
    private static String trainPassType     = "trainPassType";											   // QB
    private static String trainClass	= "trainClass";											      // QB%23D%23Z%23T%23K%23QT%23

    /**
     * 登录12306
     * 
     * @param name
     * @param password
     */
    public void login(String name, String password) {

    }

    /**
     * 检查 是否有票
     * 
     * @param from
     * @param dest
     * @param date
     * @param time
     * @param checi
     * @return
     */
    public List checkTicket(String from, String dest, String date, String time,
	    String checi) {
	//DownLoad d = new DownLoad();
	Map<String, String> parameters = new HashMap<String, String>();
	//parameters.put(key, value);
//	String url=checkUrl+"singleRoundType=1"
//		   +;
//	d.downpage(url, charset);
	return null;
    }

}
